/*    */ package xin.petstore.framework.cas;
/*    */ 
/*    */ import org.apache.shiro.cache.Cache;
/*    */ import org.apache.shiro.cache.CacheManager;
/*    */ import org.apache.shiro.session.Session;
/*    */ import org.apache.shiro.session.SessionListener;
/*    */ import org.springframework.beans.BeansException;
/*    */ import org.springframework.context.ApplicationContext;
/*    */ import org.springframework.context.ApplicationContextAware;
/*    */ 
/*    */ public class SessionExpirationListener
/*    */   implements SessionListener, ApplicationContextAware
/*    */ {
/*    */   private CacheManager cacheManager;
/*    */   private ApplicationContext applicationContext;
/*    */ 
/*    */   public CacheManager getCacheManager()
/*    */   {
/* 18 */     return this.cacheManager;
/*    */   }
/*    */ 
/*    */   public void setCacheManager(CacheManager cacheManager) {
/* 22 */     this.cacheManager = cacheManager;
/*    */   }
/*    */ 
/*    */   public void onStart(Session session)
/*    */   {
/*    */   }
/*    */ 
/*    */   public void onStop(Session session)
/*    */   {
/* 31 */     onExpiration(session);
/*    */   }
/*    */ 
/*    */   public void onExpiration(Session session)
/*    */   {
/* 36 */     String sessionId = 
/* 37 */       (String)this.cacheManager.getCache(
/* 37 */       "SERSSIONID").get(session.getId());
/* 38 */     if (sessionId != null)
/* 39 */       this.applicationContext.publishEvent(new SessionEvent(sessionId));
/*    */   }
/*    */ 
/*    */   public void setApplicationContext(ApplicationContext applicationContext)
/*    */     throws BeansException
/*    */   {
/* 46 */     this.applicationContext = applicationContext;
/*    */   }
/*    */ }

/* Location:           C:\java代码反编译器\core-1.1.4.jar
 * Qualified Name:     com.eloancn.framework.cas.SessionExpirationListener
 * JD-Core Version:    0.6.0
 */